#include "mainwindow.h"
#include "ui_mainwindow.h"

#include<QMessageBox>
#include<QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int value = QMessageBox::question(this,"对话框","您确定要退出吗?",QMessageBox::Ok  | QMessageBox::Save | QMessageBox::Cancel);
    if(value == QMessageBox::Ok)
    {
        qDebug()<<"ok";
    }
    else if(value == QMessageBox::Cancel)
    {
        qDebug()<<"cancel";
    }
    else
    {
        qDebug()<<"save";
    }
}
